class Solution1185 {
    public String dayOfTheWeek(int day, int month, int year) {
        String nameOfTheDay[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
        int dayCountOfMonth[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
        int totalYearDays = (year - 1971) * 365 + (year - 1969) / 4;
        int totalMonthDays = 0;
        for (int i = 0; i < (month - 1); i++) {
            totalMonthDays += dayCountOfMonth[i];
        }
        if ((month > 2) && (year % 4 == 0) && (year != 2100)) {
            totalMonthDays += 1;
        }

        int totalDays = totalYearDays + totalMonthDays + day;
        return nameOfTheDay[(totalDays - 3) % 7];
    }
}